/**
 * Created by 红岩 on 2015/9/13.
 */
$(function () {
    $("#login").click(function () {
        var uname = $("#uname");
        var upass = $("#upass");
		if($.trim(uname.val())==""||$.trim(upass.val())==""){
			return false;
		}
        var url = "/userlogin";
        $.post(url, {uname: uname.val(), upass: upass.val()}, function (data) {
            if (data == "1") {
                window.location.href = "/webmsg"
            } else {
                alert("登录失败")
            }
        });
    })
	$("body").keyup(function(event){
        if(event.keyCode == 13){
            $("#login").click()
        }
    });
})